#include "brick.h"
brick::brick(double w, double h, double x, double y, int style, QLabel * bbr,ball * bba)
{
    this->brickX=x;
    this->brickY=y;
    this->Height=h;
    this->Width=w;
    this->style=style;
    this->bbrick=bbr;
    this->bball=bba;
    bbrick->setGeometry(x,y,w,h);
    //bbrick->setText("[//]");
    setStyle(style);
}
void brick::setWidth(double w){
    this->Width=w;
    bbrick->setGeometry(brickX,brickY,Width,Height);
}

void brick::setHeight(double h){
    this->Height=h;
    bbrick->setGeometry(brickX,brickY,Width,Height);
}

void brick::setX(double x){
    this->brickX=x;
    bbrick->setGeometry(brickX,brickY,Width,Height);
}

void brick::setY(double y){
    this->brickY=y;
    bbrick->setGeometry(brickX,brickY,Width,Height);
}

double brick::getX(){
    return this->brickX+0.5*(this->Width);
}

double brick::getY(){
    return this->brickY+0.5*(this->Height);
}

double brick::getWidth(){
    return this->Width;
}

double brick::getHeight(){
    return this->Height;
}
void brick::setStyle(int n){
    switch(n)
    {
    case 1:
    {
        QPixmap px = QPixmap(":/ic/tt");
        bbrick->setPixmap(px);
        break;
    }
    case 2:
    {
        QPixmap px = QPixmap(":/ic/ball2");
        bbrick->setPixmap(px);
        break;

    }
    }
}

